using System;
using System.Web;
using System.Web.UI.WebControls;
using DemoPress.BlogServices;

namespace DemoPress.Web
{
    public class WebDemoControl: WebControl
    {
        private const string CONTEXTKEY = "DemoPressBlogService";
        private BlogService _blogService;

        protected BlogService BlogService
        {
            get
            {
                if (_blogService == null)
                {
                    _blogService = (BlogService)HttpContext.Current.Items[CONTEXTKEY];
                }
                return _blogService;
            }
        }
    }
}
